import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JPanel;



public class CustomListPanel extends JPanel {
	public JButton scrollUp;
	public JButton scrollDown;
	public JPanel customGameList;
	
	public CustomListPanel(){
		this.setPreferredSize(new Dimension(750, 600));
		this.setBackground(new Color(85, 85, 85));
		this.setLayout(new BorderLayout());
		
		scrollUp = new JButton();
		scrollUp.setPreferredSize(new Dimension(196, 20));
		scrollUp.setIcon(new ImageIcon("uparrow.png"));
		scrollUp.addActionListener(new UpListener());
		this.add(scrollUp, BorderLayout.NORTH);
		
		scrollDown = new JButton();
		scrollDown.setPreferredSize(new Dimension(196, 20));
		scrollDown.setIcon(new ImageIcon("downarrow.png"));
		scrollDown.addActionListener(new DownListener());
		this.add(scrollDown, BorderLayout.SOUTH);	
		
		customGameList = new JPanel();
		customGameList.setBackground(Color.white.darker());
		customGameList.setLayout(new GridLayout(8, 1, 0, 0));
		this.add(customGameList, BorderLayout.CENTER);
		
		CustomBarPanel cbp1 = new CustomBarPanel();
		cbp1.on("Brocraft's Classic Risk Game", "Escalating", 800, 1200);
		customGameList.add(cbp1);
		
		CustomBarPanel cbp2 = new CustomBarPanel();
		cbp2.on("ChadJ's Europa", "Classic", 1800, 2200);
		customGameList.add(cbp2);
		
		CustomBarPanel cbp3 = new CustomBarPanel();
		cbp3.on("Cardinal's Aussieland", "Classic", 600, 700);
		customGameList.add(cbp3);
	}
	private class UpListener implements ActionListener{
		public void actionPerformed(ActionEvent e){
			System.out.println("ScrollUp");
		}
	}
	private class DownListener implements ActionListener{
		public void actionPerformed(ActionEvent e){
			System.out.println("ScrollDown");
		}
	}
}
